      SUBROUTINE SBINIT
C
      IMPLICIT REAL*8(A-H,O-Z)
C
      COMMON/ACFILT/ACPARM(20),IACFLT(20)
C
      COMMON/ADSTAT/DER(150),DEP(150)
C
      COMMON/CONSTS/PI,TWOPI,RADIAN
C
      COMMON/CRASTR/DELA(3),TAUA(4,3),ANG20(3),ADD0(3),TC(3),TTAB(4,3)
C
      COMMON/CSECBD/SECM,SECI(3,3),ZBAR2(3),YI02(3),ZZ2(3,3),ZZ2Y(3,3)
     1             ,YZ2(3),YZT(3),ZB(3),YIZ02(3)
C
      COMMON/ISECBD/I2BDY,NDOF2,IRAST,NDEP2,IARST(3),IRSCY(3)
C
      COMMON/PWHEEL/XMOMIN(3),DVMOM(3),VMOM(3),VW(3)
C
      COMMON/SECBDW/GAMMA2(3,6),DELTA2(3,3),DELT2(3,3),DELT2I(3,3)
C
      COMMON/SECICS/GAM20,ALP20,BET20,B0(3,3),GAM2I,ALP2I,BET2I
     1             ,OM2I(3),SBUP(2),SBDN(2)
C
      COMMON/XIN4  /UP(150),DN(150),BNDS(22)
C
C
      IF(I2BDY.EQ.0) GO TO 100
C
      GAM=GAM20*RADIAN
      ALP=ALP20*RADIAN
      BET=BET20*RADIAN
C
      CALL DTR312(GAM,ALP,BET,B0)
C
      ZZ2(1,1)=0.5D0*(SECI(2,2)+SECI(3,3)-SECI(1,1))
     1         +SECM*ZBAR2(1)*ZBAR2(1)
      ZZ2(2,2)=0.5D0*(SECI(3,3)+SECI(1,1)-SECI(2,2))
     1         +SECM*ZBAR2(2)*ZBAR2(2)
      ZZ2(3,3)=0.5D0*(SECI(1,1)+SECI(2,2)-SECI(3,3))
     1         +SECM*ZBAR2(3)*ZBAR2(3)
      ZZ2(1,2)=SECI(1,2)+SECM*ZBAR2(1)*ZBAR2(2)
      ZZ2(1,3)=SECI(1,3)+SECM*ZBAR2(1)*ZBAR2(3)
      ZZ2(2,3)=SECI(2,3)+SECM*ZBAR2(2)*ZBAR2(3)
      ZZ2(2,1)=ZZ2(1,2)
      ZZ2(3,1)=ZZ2(1,3)
      ZZ2(3,2)=ZZ2(2,3)
C
      IF(NDOF2.EQ.0) GO TO 100
C
      GAM2=GAM2I*RADIAN
      ALP2=ALP2I*RADIAN
      BET2=BET2I*RADIAN
C
      SALP=DSIN(ALP2)
      CALP=DCOS(ALP2)
      SBET=DSIN(BET2)
      CBET=DCOS(BET2)
      GAM2D=0.0D0
C
      IF(NDOF2.EQ.1) GO TO 20
      GAM2D=(OM2I(3)*CBET-OM2I(1)*SBET)*RADIAN/CALP
C
   20 CONTINUE
C
      BET2D=OM2I(2)*RADIAN-GAM2D*SALP
      I0=NDEP2
      I1=I0+NDOF2
      DEP(I0)=BET2
      DEP(I1)=BET2D
      UP(I0)=SBUP(1)
      DN(I0)=SBDN(1)
      UP(I1)=SBUP(2)
      DN(I1)=SBDN(2)
C
      IF(NDOF2.EQ.1) GO TO 80
C
      I0=I0+1
      I1=I1+1
      DEP(I0)=GAM2
      DEP(I1)=GAM2D
      UP(I0)=SBUP(1)
      DN(I0)=SBDN(1)
      UP(I1)=SBUP(2)
      DN(I1)=SBDN(2)
C
      IF(NDOF2.EQ.2) GO TO 80
C
      ALP2D=(OM2I(1)*CBET+OM2I(3)*SBET)*RADIAN
      I0=I0+1
      I1=I1+1
      DEP(I0)=ALP2
      DEP(I1)=ALP2D
      UP(I0)=SBUP(1)
      DN(I0)=SBDN(1)
      UP(I1)=SBUP(2)
      DN(I1)=SBDN(2)
C
   80 CONTINUE
C
      DELTA2(1,1)=ZZ2(2,2)+ZZ2(3,3)
      DELTA2(2,2)=ZZ2(3,3)+ZZ2(1,1)
      DELTA2(3,3)=ZZ2(1,1)+ZZ2(2,2)
      DELTA2(1,2)=-ZZ2(1,2)
      DELTA2(1,3)=-ZZ2(1,3)
      DELTA2(2,3)=-ZZ2(2,3)
      DELTA2(2,1)=DELTA2(1,2)
      DELTA2(3,1)=DELTA2(1,3)
      DELTA2(3,2)=DELTA2(2,3)
C
C
  100 CONTINUE
C
      DO 105 I=1,3
      VW(I)=VMOM(I)
  105 CONTINUE
C
      IF(IRAST.EQ.0) GO TO 150
C
      DO 120 I=1,3
      ITEST=IARST(I)
      IF(ITEST.EQ.0) GO TO 120
      IF(ITEST.EQ.2) GO TO 110
C
C     TYPE 1 CYCLE
C
      TC(I)=2.0D0*(TAUA(2,I)+2.0D0*TAUA(3,I)+TAUA(4,I))
      TTAB(1,I)=TAUA(2,I)/2.0D0
      TTAB(2,I)=TTAB(1,I)+TAUA(3,I)
      TTAB(3,I)=TTAB(2,I)+TAUA(4,I)
      TTAB(4,I)=TTAB(3,I)+TAUA(3,I)
      ADD0(I)=DELA(I)*PI/(2.0D0*TAUA(3,I)*(TAUA(3,I)+TAUA(4,I)))
C
      GO TO 120
C
  110 CONTINUE
C
C     TYPE 2 CYCLE
C
      TC(I)=TAUA(2,I)+TAUA(3,I)
      TTAB(1,I)=TAUA(2,I)
      TTAB(2,I)=TTAB(1,I)+TAUA(3,I)
      ADD0(I)=DELA(I)*TWOPI/TAUA(2,I)**2
C
  120 CONTINUE
C
  150 CONTINUE
C
      IF(IACFLT(1).EQ.0) RETURN
C
      I0=IACFLT(6)
      I1=I0+1
      UP(I0)=ACPARM(19)
      DN(I0)=ACPARM(20)
      UP(I1)=ACPARM(19)
      DN(I1)=ACPARM(20)
      IF(IACFLT(4).EQ.0) GO TO 155
      DEP(I0)=ACPARM(17)
      DEP(I1)=ACPARM(18)
  155 CONTINUE
C
C
      RETURN
C
      END
